package org.elanfox.cloud.common.exception;

import lombok.Getter;
import org.elanfox.cloud.common.base.ApiResult;

/**
 * @author allan
 * @date 2019-08-16
 */
@Getter
public class ApiException extends RuntimeException {
    private ApiResult<Void> apiResult;

    public ApiException(String message, ApiResult<Void> apiResult) {
        super(message);
        this.apiResult = apiResult;
    }

    public ApiException(ApiResult<Void> apiResult) {
        super(apiResult.getMsg());
        this.apiResult = apiResult;
    }
}
